package com.example.confessionwall.mapper;

import com.example.confessionwall.model.Message;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface MessageMapper {
    @Insert("insert into message(from_user, to_user, message) " +
            "values(#{fromUser}, #{toUser}, #{message})")
    Integer insertMessage(Message message);

    @Select("select * from message")
    List<Message> selectAll();
}
